using System;
using System.Collections.Generic;
using System.Text;
using FlatRedBall;
using FlatRedBall.Input;
using FlatRedBall.AI.Pathfinding;
using FlatRedBall.Graphics.Animation;
using FlatRedBall.Graphics.Particle;

using FlatRedBall.Math.Geometry;
using FlatRedBall.Math.Splines;
using BitmapFont = FlatRedBall.Graphics.BitmapFont;
using Cursor = FlatRedBall.Gui.Cursor;
using GuiManager = FlatRedBall.Gui.GuiManager;

#if FRB_XNA || SILVERLIGHT
using Keys = Microsoft.Xna.Framework.Input.Keys;
using Vector3 = Microsoft.Xna.Framework.Vector3;
using Texture2D = Microsoft.Xna.Framework.Graphics.Texture2D;


#endif

namespace MultiplayerTD.Entities
{
	public partial class Bullet
	{
        public Mob Target { get; set; }

		private void CustomInitialize()
		{
            Target = null;

		}

		private void CustomActivity()
		{
            if (Target != null)
            {
                Vector3 path = Vector3.Subtract(Target.Position, Position);
                path.Normalize();
                path = Vector3.Multiply(path, 10.0f);
                Position = Vector3.Add(Position, path);

                if (Vector3.Distance(Position, Target.Position) < 10)
                {
                    this.Destroy();
                }
            }

            
		}

		private void CustomDestroy()
		{
            Target = null;
		}

        private static void CustomLoadStaticContent(string contentManagerName)
        {


        }
	}
}
